<%@ Page Language="C#" MasterPageFile="~/Master/PlacementManager.master" Theme="YUI"
    AutoEventWireup="true" CodeFile="ManageContactAttributes.aspx.cs" Inherits="Home_ManageContactAttributes"
    Title="PlacementManager: Contact Attributes" StylesheetTheme="YUI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div class="yui-b">
        
    </div>
    <div id="yui-main">
        <div class="yui-b">
        <h1>Manage Contact Attributes</h1>
            <p>
                Use this form to manage the attributes with which a contact can be associated. These
                can be used to distinguish between contacts when searching or reporting. Contact
                attributes are School or Division specific.</p>
            <asp:GridView ID="gvContactAttributes" runat="server" AutoGenerateColumns="False"
                DataKeyNames="ContactAttributeId" DataSourceID="odsContactAttributes" SkinID="Results"
                EmptyDataText="No contact attributes have been created for this Division." OnRowUpdating="gvContactAttributes_RowUpdating">
                <Columns>
                    <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/Icons/against.gif"
                        EditImageUrl="~/Images/Icons/edit.gif" ShowEditButton="True" UpdateImageUrl="~/Images/Icons/refresh.gif" />
                    <asp:BoundField DataField="AttributeName" HeaderText="AttributeName" SortExpression="AttributeName" />
                    <asp:BoundField DataField="DateCreated" HeaderText="DateCreated" SortExpression="DateCreated"
                        DataFormatString="{0:MMM dd, yyyy}" HtmlEncode="False" ReadOnly="True" />
                    <asp:BoundField DataField="CreatedBy" HeaderText="CreatedBy" SortExpression="CreatedBy"
                        ReadOnly="True" />
                    <asp:BoundField DataField="DateUpdated" HeaderText="DateUpdated" SortExpression="DateUpdated"
                        DataFormatString="{0:MMM dd, yyyy}" HtmlEncode="False" ReadOnly="True" />
                    <asp:BoundField DataField="UpdatedBy" HeaderText="UpdatedBy" SortExpression="UpdatedBy"
                        ReadOnly="True" />
                </Columns>
            </asp:GridView>
            <br />
            <asp:Label ID="lblNewAttributeName" runat="server" CssClass="formLabel" Text="Name:"></asp:Label>
            <asp:TextBox ID="txtNewAttributeName" runat="server"></asp:TextBox>&nbsp;&nbsp;<asp:Button
                ID="btnAddNewAttribute" runat="server" CssClass="inputbutton" OnClick="btnAddNewAttribute_Click"
                Text="Add New Attribute" />
        </div>
    </div>
    
    <asp:ObjectDataSource ID="odsContactAttributes" runat="server" DataObjectTypeName="PlacementManager.ContactAttribute"
        DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectAllWDivisionId" TypeName="PlacementManager.ContactAttributeComponent"
        UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="ContactAttributeId" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:SessionParameter DefaultValue="1" Name="divisionId" SessionField="DivisionId"
                Type="Int32" />
            <asp:Parameter DefaultValue="DateCreated" Name="sortExpression" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="DivisionId" Type="Int32" />
            <asp:Parameter Name="AttributeName" Type="String" />
            <asp:Parameter Name="IsActive" Type="Boolean" />
            <asp:Parameter Name="DateCreated" Type="DateTime" />
            <asp:Parameter Name="CreatedBy" Type="String" />
            <asp:Parameter Name="DateUpdated" Type="DateTime" />
            <asp:Parameter Name="UpdatedBy" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>
